Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memoize tagset cursor's key #3676

Merged
merged 2 commits into from
Aug 15, 2015
Merged

Memoize tagset cursor's key #3676

merged 2 commits into from
Aug 15, 2015

Conversation

otoolep
Copy link
Contributor

@otoolep otoolep commented Aug 15, 2015

CPU profiling shows that computing the tagset-based key of each point is significant CPU cost (formMeasurementTagSetKey). These keys actually don't change per cursor, so precompute per tagset cursor, and then tack this value onto mapper outputs.

Before this change the cursor tagset-based key was getting computed for every point emitted by that cursor, which involved marshalling tags ever time a point was emitted.

With this change in place, on my machine, a partner's test query execution time was reduced by 30-40%.

@otoolep otoolep force-pushed the memomize_key branch 3 times, most recently from c1bf16e to 9a67776 Compare August 15, 2015 02:55
CPU profiling shows that computing the tagset-based key of each point is significant CPU cost. These keys actually don't change per cursor, so precompute once at mapper-open time, and then use those values as points are drained from the cursor.

Before this change the cursor tag was getting computed on every point, which involved marshalling tags.
@otoolep
Copy link
Contributor Author

otoolep commented Aug 15, 2015

@corylanou
Copy link
Contributor

+1, great find!

@dgnorton
Copy link
Contributor

+1

otoolep added a commit that referenced this pull request Aug 15, 2015
@otoolep otoolep merged commit c2dbf16 into master Aug 15, 2015
@otoolep otoolep deleted the memomize_key branch August 15, 2015 03:39
@otoolep otoolep changed the title Memomize tagset cursor's key Memoize tagset cursor's key Aug 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants